home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / mint / mgr / mgr.zoo / include.zoo / restart.h < prev    next >
Encoding:
C/C++ Source or Header  |  1991-03-22  |  1.4 KB  |  50 lines

  1. /*                        Copyright (c) 1987 Bellcore
  2.  *                            All Rights Reserved
  3.  *       Permission is granted to copy or use this program, EXCEPT that it
  4.  *       may not be sold for profit, the copyright notice must be reproduced
  5.  *       on copies, and credit should be given to Bellcore where it is due.
  6.  *       BELLCORE MAKES NO WARRANTY AND ACCEPTS NO LIABILITY FOR THIS PROGRAM.
  7.  */
  8. /*    $Header: /home/bammi/atari/mgr/sparcmgr/lib/RCS/restart.h,v 1.1 1991/03/22 14:28:56 bammi Exp bammi $
  9.     $Source: /home/bammi/atari/mgr/sparcmgr/lib/RCS/restart.h,v $
  10. */
  11. static char    h_restart_[] = "$Source: /home/bammi/atari/mgr/sparcmgr/lib/RCS/restart.h,v $$Revision: 1.1 $";
  12.  
  13. /* stuff for restarting upon reshape/ redraw */
  14.  
  15. #ifndef ECHO
  16. #include <sgtty.h>
  17. #endif
  18.  
  19. #include <setjmp.h>
  20.  
  21. #ifndef SIGQUIT
  22. #include <signal.h>
  23. #endif
  24.  
  25. #if __STDC__
  26. void _Catch (void);
  27. void _Clean (void);
  28. #else
  29. extern int _Catch(), _Clean();
  30. extern jmp_buf _env;
  31. #endif
  32.  
  33. #ifdef QUIT_CHAR
  34. static char *_quit = QUIT_CHAR;
  35. #else
  36. static char *_quit = "\034";
  37. #endif
  38.  
  39. #define Ignore()    signal(SIGQUIT,SIG_IGN)
  40.  
  41. #define Restart()    signal(SIGINT,_Clean), \
  42.              signal(SIGTERM,_Clean), \
  43.              signal(SIGQUIT,_Catch), \
  44.              m_saveenvcount = m_envcount, \
  45.              m_pushsave(P_EVENT), \
  46.              m_setevent(RESHAPE,_quit), \
  47.              m_setevent(REDRAW,_quit), \
  48.              m_setevent(UNCOVERED,_quit), \
  49.              setjmp(_env)
  50.